/**
 * There are code generation
 */
package com.neusoft.lohas.modules.ivm.dao.merchant;

import org.springframework.stereotype.Repository;

import com.neusoft.lohas.common.persistence.BaseDao;
import com.neusoft.lohas.common.persistence.Parameter;
import com.neusoft.lohas.modules.ivm.entity.merchant.DeliveryIndent;
import com.neusoft.lohas.modules.ivm.entity.order.Order;

/**
 * 送货员送货详情DAO接口
 * @author Jackie.Liu
 * @version 2014-11-03
 */
@Repository
public class DeliveryIndentDao extends BaseDao<DeliveryIndent> {

	public DeliveryIndent findByOrderId(String orderId) {
		return getByHql("from DeliveryIndent where order.id = :p1 and delFlag = :p2", new Parameter(orderId, Order.DEL_FLAG_NORMAL));
	}

	public int deleteIndentById(String id) {
		String sql = "delete from ivm_delivery_indent where id = :p1";
		return super.updateBySql(sql, new Parameter(id));
	}
}
